// pages/index/home/home.js
Page({

  register() {
    wx.nav('../register/register')
  },

  info() {
    wx.nav('../info/info')
  },

  group() {
    wx.nav('../../module/group/group')
  },

  data: {
    loading: true,
    register: true,
  },

  onLoad: function (options) {
    this.setData({ loading: true });
    wx.login({
      success: code => {
        wx.post('login', { code: code.code }, res => {
          this.setData({ loading: false });
          if (res) {
            wx.appData.user = res;
            this.setData({ register: false });
          } 
        })
      },
    })
  },
  call() {
    wx.copyright();
  },

  onShareAppMessage: function () {

  }
})